package com.eliota.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.eliota.entity.User;
import org.apache.ibatis.annotations.*;

import java.sql.Timestamp;
import java.util.List;

/**
 * @author M.G
 * @create 2023-03-17 10:50
 * @date 2023/3/17 10:50
 */


public interface UserMapper extends BaseMapper<User>{



    @Update("update t_user set statue = 0 where id = #{id}")
    boolean updateStatue(Integer id);
    /*    *//**
     * 查找所有
     * @return
     *//*
    @Select("select * from gew.t_user")
    List<User> findAll();

    @Select("select t_user.id,username, password, nikename, phone, email, address from gew.t_user limit #{pageNum},#{pageSize};")
    List<User> selectPage(Integer pageNum,Integer pageSize);

    @Select("select t_user.id,username, password, nikename, phone, email, address " +
            "from gew.t_user where username like concat('%',#{userName},'%')" +
            "limit #{pageNum},#{pageSize}")
    List<User> selectPageByName(Integer pageNum,Integer pageSize,String userName);

    @Select("select count(username) from gew.t_user where username like concat('%',#{userName},'%')")
    Integer selectTotal(String userName);

    *//**
     * 查id用户记录条数
     * @param id
     * @return
     *//*
    @Select("select count(1) from gew.t_user where id = #{id}")
    int countId(Integer id);


    *//**
     * 插入数据
     * @param user
     * @return
     *//*
    @Insert("insert into gew.t_user(username, password, nikename, phone, email, address)\n" +
            "values (#{userName},#{password},#{nikeName},#{phone},#{email},#{address})")
     int insert(User user);


    int updateUser(User user);

    @Delete("delete from gew.t_user where id  = #{id};")
    int deleteById(Integer id);*/

}
